package com.lzx.iteam;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.lzx.iteam.base.FindViewById;
import com.lzx.iteam.base.MyBaseActivity;
import com.lzx.iteam.widget.TextMoreView;

/**
 * Created with IntelliJ IDEA.
 * **********************************
 * User: zhangshuai
 * Date: 2016年 12月 08日
 * Time: 上午11:11
 *
 * @QQ : 1234567890
 * **********************************
 */
public class AttendanceFixDataActivity extends MyBaseActivity implements View.OnClickListener{

    @FindViewById(id = R.id.title_ll_back)
    private LinearLayout mLayoutBack;
    @FindViewById(id = R.id.title_tv_center)
    private TextView mTvTitle;
    @FindViewById(id = R.id.title_tv_right)
    private TextView mTvRight;
    @FindViewById(id = R.id.ll_layout_action)
    private LinearLayout mLayoutItem;
    @FindViewById(id = R.id.tm_at_fix)
    private TextMoreView mMoreFix;
    @FindViewById(id = R.id.tm_at_feed)
    private TextMoreView mMoreFeed;

    private String mAttendanceId;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState,R.layout.attendance_fix_layout);
    }

    @Override
    public void initListener() {
        mLayoutBack.setOnClickListener(this);
        mMoreFix.setOnClickListener(this);
        mMoreFeed.setOnClickListener(this);
    }

    @Override
    public void initData() {
        mTvTitle.setText("在线修复");
        mLayoutItem.setVisibility(View.VISIBLE);
        mMoreFix.setImageGone();
        mMoreFeed.setImageGone();

        Intent intent = getIntent();
        mAttendanceId = intent.getStringExtra("attendance_id");
    }


    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.title_ll_back:
                finish();
                break;
            case R.id.tm_at_fix:
                Intent fix = new Intent(this,AttendanceFixProgressActivity.class);
                fix.putExtra("attendance_id",mAttendanceId);
                startActivity(fix);
                break;
            case R.id.tm_at_feed:
                Intent feed = new Intent(this,FeedActivity.class);
                feed.putExtra("action",1);
                feed.putExtra("attendance_id",mAttendanceId);
                startActivity(feed);
                break;
        }
    }
}
